<{include file="ucenter/block/header.html"}>
<div class="ucenter_t">
    <ul><li class="on">我的设计</li></ul>
    <span class="r"><a href="<{link ctl='ucenter/member/mydesign:create'}>" class="pbtn" target="_blank">创建新的设计</a></span>
</div>
<div class="ucenter_c">
    <table width="100%" border="0" cellspacing="0" class="table">
        <tr>
            <th>标题</th>
            <th>图片</th>
            <th class="w-100">地区</th>
            <th class="w-150">户型</th>
            <th class="w-100">修改时间</th>
            <th class="w-200">操作</th>
        </tr>
            <{foreach $designs as $item}>
                <tr>
                    <td><{$item->name}></td>
                    <td><img style="width: 123px;height: 83px" src="<{$item->mainPic}>" alt="<{$item->name}>"></td>
                    <td><{$item->obsPlan->planCity}></td>
                    <td><{$item->obsPlan->specName}></td>
                    <td><{$item->formatModifiedTime}></td>
                    <td>
                        <input name="designid" type="hidden" value="<{$item->obsDesignId}>">
                        <a href="<{link ctl='ucenter/member/mydesign:edit3d' arg0=$item->obsDesignId}>" class="pbtn" target="_blank">编辑</a>
                        <a href="<{link ctl='ucenter/member/mydesign:delete3d' arg0=$item->obsDesignId}>" mini-act="删除" mini-confirm="确定要删除吗？" class="pbtn red">删除</a>
                        <a href="javascript:void(0);" class="pbtn submitdesign">提交推荐</a>
                    </td>
                </tr>
            <{foreachelse}>
            <tr><td colspan="6"><p class="tips"><span class="notice">没有数据</span></p></td></tr>
            <{/foreach}>
    </table>
<!--    <div class="page"><{$pager.pagebar}></div>-->
</div>
<style>
    a.submitdesign:hover{text-decoration: none}
</style>
<script type="text/javascript">
    $(function(){
        $(".submitdesign").on('click',function(){
            var parentTr = $(this).parent().parent();

            $.ajax({
                url: "<{link ctl='ucenter/member/mydesign:submit3d'}>",
                type: "POST",
                dataType: "json",
                async:true,
                data:{
                    designid:$(parentTr).find("td:last input[type=hidden]").val(),
                    name: $(parentTr).find("td:first").html(),
                    mainPic: $(parentTr).find("td:eq(1) img").attr("src")
                }
            }).success(function(response){
                alert(response.message[0])
            });
        })
    })
</script>
<{include file="ucenter/block/footer.html"}>